package com.jlz.beans.core;

import java.util.List;
import java.util.Map;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.jlz.beans.def.DivisionBean;
import com.julewa.db.DB;
import com.julewa.db.Entity;

/*
 * 合同
 * 并不当做正式合同,只是作为一个电子记载,用作特殊处理
 * 
 * 只是要实现双人确认过程
 * 
 */
@DB.DYNAMIC
@Component @Scope(Entity.SCOPE)
public class ContractBean  extends Dynamic<Long>{
	@DB.COLUMN long ownerId;
	@DB.COLUMN long assetId;
	@DB.COLUMN long lenderId;
	//双方一致的状态才是合同的真状态
	//否则处于非法状态
	//只有同处于编辑状态,才能执行编辑
	@DB.COLUMN int ownerState;//编辑-确认-暂停-关闭-删除
	@DB.COLUMN int lenderState;//编辑-确认-暂停-关闭-删除
	
	@DB.COLUMN long createDate;//借约日
	@DB.COLUMN long revertDate;//归还日
	
	//这是为了复制地址数据,保证正确
	@DB.COLUMN long divisionId;//位置
	DivisionBean division = null;
	@DB.COLUMN String address;//详细地址
	
	@DB.COLUMN int noticePeriod;//提醒周期
	@DB.COLUMN int noticeTimeunit;//提醒时间单位
	@DB.COLUMN long noticeDate;//下一个提醒日
	
	@DB.COLUMN int count;//数目

	//关键的价格规则定义
	List<PriceBean> prices = null;
	
	//其他规则的定义
	//这里的数据是直接以C_XX的方式放在表中
	//以方便查询处理
	Map<String, Object> properties = null;
		
	//还有特殊的附属表
	List<String> rules;
	
	@DB.COLUMN String pictures;//以;隔开

	////
	public long getOwnerId() {
		return ownerId;
	}

	public void setOwnerId(long ownerId) {
		this.ownerId = ownerId;
	}

	public long getAssetId() {
		return assetId;
	}

	public void setAssetId(long assetId) {
		this.assetId = assetId;
	}

	public long getLenderId() {
		return lenderId;
	}

	public void setLenderId(long lenderId) {
		this.lenderId = lenderId;
	}

	public int getOwnerState() {
		return ownerState;
	}

	public void setOwnerState(int ownerState) {
		this.ownerState = ownerState;
	}

	public int getLenderState() {
		return lenderState;
	}

	public void setLenderState(int lenderState) {
		this.lenderState = lenderState;
	}

	public long getCreateDate() {
		return createDate;
	}

	public void setCreateDate(long createDate) {
		this.createDate = createDate;
	}

	public long getRevertDate() {
		return revertDate;
	}

	public void setRevertDate(long revertDate) {
		this.revertDate = revertDate;
	}

	public long getDivisionId() {
		return divisionId;
	}

	public void setDivisionId(long divisionId) {
		this.divisionId = divisionId;
	}

	public DivisionBean getDivision() {
		return division;
	}

	public void setDivision(DivisionBean division) {
		this.division = division;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public int getNoticePeriod() {
		return noticePeriod;
	}

	public void setNoticePeriod(int noticePeriod) {
		this.noticePeriod = noticePeriod;
	}

	public int getNoticeTimeunit() {
		return noticeTimeunit;
	}

	public void setNoticeTimeunit(int noticeTimeunit) {
		this.noticeTimeunit = noticeTimeunit;
	}

	public long getNoticeDate() {
		return noticeDate;
	}

	public void setNoticeDate(long noticeDate) {
		this.noticeDate = noticeDate;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public List<PriceBean> getPrices() {
		return prices;
	}

	public void setPrices(List<PriceBean> prices) {
		this.prices = prices;
	}
 
	public Map<String, Object> getProperties() {
		return properties;
	}

	public void setProperties(Map<String, Object> properties) {
		this.properties = properties;
	}

	public List<String> getRules() {
		return rules;
	}

	public void setRules(List<String> rules) {
		this.rules = rules;
	}

	public String getPictures() {
		return pictures;
	}

	public void setPictures(String pictures) {
		this.pictures = pictures;
	}
	
	//
	
}
